<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>

<!-- type="module"表示引入ES6模块 -->
<script type="module">
    import { Group, Matrix4, Vector3, Object3D, Scene } from './js/three.module.js';
    //Group 数组对象
    //Scene Three.js中的顶层对象,包含了所有物体,即世界对象

    //世界坐标系
    const m1 = new Matrix4();
    m1.elements = [
        1, 0, 0, 0,
        0, 1, 0, 0,
        0, 0, 1, 0,
        0, 0, 0, 1
    ];

    //本地坐标系
    const m2 = new Matrix4();
    m1.elements = [
        1, 0, 0, 0,
        0, 1, 0, 0,
        0, 0, 1, 0,
        1, 2, 3, 1
    ];

    //目标点
    const p2 = new Vector3(4, 5, 6);

    //创建一个世界对象
    const universe = new Scene();
    //赋予世界坐标系
    universe.applyMatrix4(m1);

    const galaxy = new Group();
    galaxy.applyMatrix4(m2);

    const obj01 = new Object3D();
    obj01.position.copy(p2);

    galaxy.add(obj01);
    universe.add(galaxy);

    const p1 = new Vector3();
    obj01.getWorldPosition(p1);




</script>

</html>